#include <bits/stdc++.h>

using namespace std;

bool fncomp(int lhs, int rhs) { return lhs < rhs; }

struct classcomp {
	bool operator() (const int &lhs, const int &rhs) const
	{
		return lhs < rhs;
	}
};

int main(void)
{
	/* set, 有序的不重复的集合，默认升序排列 */
	set<int> first;                            // 空构造

	int myints[] = { 10,30,20,50,40,40 }; // 40重复
	set<int> second(myints, myints + 5);        // 范围构造

	set<int> third(second);                  // 拷贝构造

	set<int> fourth(second.begin(), second.end());  // 迭代器构造

	set<int, classcomp> fifth;                 // 类作为比较

	bool(*fn_pt)(int, int) = fncomp;
	set<int, bool(*)(int, int)> sixth(fn_pt);  // 函数指针作为比较

	// 迭代器
	for (auto it = second.begin(); it != second.end(); ++it) {
		cout << *it << " ";
	}
	cout << endl;

	return 0;
}
